const webpack = require('webpack')
const path = require('path')

function resolve (dir) {
    return path.join(__dirname, dir)
}

module.exports = {
  baseUrl: './',
  chainWebpack: config => {
    config.resolve.alias
        .set('@', resolve('src'))
  },
  devServer: {
    proxy: {
      '/api': {
        target: 'http://120.78.213.231:82/api',
        // target: 'http://192.168.1.209:8090/api',
        changeOrigin: true,
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  configureWebpack: {
    plugins: [
      new webpack.ProvidePlugin({
          jQuery: 'jquery',
          $: 'jquery'
      })
    ]
  }
}